function isCat(animal) {
    return animal.type === "cat";
}
function makeSound(animal) {
    if (isCat(animal)) {
        animal.meow();
        return "Cat says meow";
    }
    else {
        animal.bark();
        return "Dog says bark";
    }
}
var animal1 = { type: 'cat', meow: function () { return console.log('meow'); } };
var animal2 = { type: 'dog', bark: function () { return console.log('bark'); } };
console.log(makeSound(animal1));
console.log(makeSound(animal2));
